Skip to content

Conversation

@jbj
Copy link
Contributor

@jbj jbj commented Sep 27, 2018

This change means that there are no results for unresolveElement(t) where t is a "junk type" -- a class definition that is not in the image of resolveClass. These "junk types" still exist as Elements, but they will never be returned by any predicate that goes through unresolveElement to query the db.

We get a small reduction in DIL size and a significant speed improvement. The DIL for NewArrayDeleteMismatch.ql is reduced from 27,630 lines to 27,507 lines, and the total analysis time for the LGTM suite on jdk8u is reduced from 1158s to 984s. This makes it faster than 1.17.2 on jdk8u, even when disregarding the one query where 1.17.2 has a serious performance problem.

This change is in quite similar to #215. The main difference is that the inlined type check is (effectively) t instanceof @usertype instead of isClass(t), and the former is much easier for the optimiser to eliminate statically.

jbj added 2 commits September 27, 2018 13:23
This change means that there are no results for `unresolveElement(t)`
where `t` is a "junk type" -- a class definition that is not in the
image of `resolveClass`. These "junk types" still exist as `Element`s,
but they will never be returned by any predicate that goes through
`unresolveElement` to query the db.

We get a small reduction in DIL size and a significant speed
improvement. The DIL for `NewArrayDeleteMismatch.ql` is reduced from
27,630 lines to 27,507 lines, and the total analysis time for the LGTM
suite on jdk8u is reduced from 1158s to 984s.
The change to make `unresolveElement` a member predicate was helpful for
the optimiser when it dispatched on `this`, but now that it "dispatches"
on `result` it's just an unnecessary pollution of the `ElementBase`
namespace.
@jbj jbj added the C++ label Sep 27, 2018
@jbj jbj added this to the 1.18 milestone Sep 27, 2018
@jbj jbj requested review from ian-semmle and pavgust September 27, 2018 11:33
@ian-semmle ian-semmle merged commit 077ce6a into github:rc/1.18 Sep 27, 2018
aibaars added a commit that referenced this pull request Oct 14, 2021
smowton pushed a commit to smowton/codeql that referenced this pull request Feb 7, 2022
Add fallback symbol lookup for IrFunctionReference extraction
MathiasVP pushed a commit to MathiasVP/ql that referenced this pull request Aug 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants